<?php
/*
 * description：
 * author：wh
 * email：
 * createTime：{2020/4/17} {16:36} 
 */

namespace libraries;


class BaseConstants
{
    private $ReflectionClassObject = null;
    private function getReflectionClassObject(){
        if(null == $this->ReflectionClassObject){
            return new \ReflectionClass($this);
        }
        return $this->ReflectionClassObject;
    }
    /**
     * desc：
     * author：wh
     * @return array
     * @throws \ReflectionException
     */
    function getAllConst(){

        $obj = $this->getReflectionClassObject();

        return $obj->getConstants();
    }

    /**
     * desc：
     * author：wh
     * @return array
     */
    function getAllVars(){
        $obj = $this->getReflectionClassObject();

        return $obj->getDefaultProperties();
    }

    /**
     * desc：
     * author：wh
     * @return array
     */
    function getAllMethods(){
        $obj = $this->getReflectionClassObject();

        $s = $obj->getMethods();
        return array_column($s, 'name');
    }


}